<?php



class Social_Adapter_Google extends Social_Adapter_OAuthAbstract
{

	/**
	 * @var string
	 */
	protected $_serviceId = 'google';


	/**
	 * @return void
	 */
	function __construct()
	{
		require_once LEGACY_DIR . 'social/googleapi/apiClient.php';
	}

	/**
	 * adapter
	 */
	function getClientApi()
	{

		if (NULL == $this -> _clientApi)
		{

			$clientApi = new apiClient();

			$clientApi -> setApplicationName('namnv.younetco.com');

			$clientApi -> setScopes(array(
				"https://www.googleapis.com/auth/userinfo#email",
				"https://www.googleapis.com/auth/userinfo.profile"
			));

			$configApi = Nuo::getApi('core/config');

			$clientId = '627822103123.apps.googleusercontent.com';
			$clientSecret = '7fg1zaSkbDwk30CS77WGOx6w';
			$redirectUri = $this -> getCallbackUrl();

			$clientApi -> setClientId($clientId);
			$clientApi -> setClientSecret($clientSecret);
			$clientApi -> setRedirectUri($redirectUri);

			$this -> _clientApi = $clientApi;
		}

		return $this -> _clientApi;
	}

}
